<?php

class Feedback extends CI_Controller {

    public function __construct() {
        parent::__construct();
        $this->load->helper('form');
        $this->load->library('form_validation');
    }

    public function userview() {
        $this->load->helper('form');
        $this->load->view('form_feedback');
    }

    public function index() {
        /* $this->form_validation->set_rules('name', 'Họ tên', 'trim|required|max_length[50]|xss_clean');
          $this->form_validation->set_rules('sdt', 'Số điện thoại', 'required|numeric');
          $this->form_validation->set_rules('email', 'Email', 'trim|required|valid_email');
          $this->form_validation->set_rules('title', 'Tiêu đề', 'trim|required');
          $this->form_validation->set_rules('content', 'Nội dung', 'required');
          $this->form_validation->set_message('required','Không được để trống.');
          $this->form_validation->set_message('numeric','Chỉ được điền số.');
          $this->form_validation->set_message('valid_email','Email không hợp lệ.'); */
        /* $data = Array
          (
          'hoten' => $this->input->post('name'),
          'email' => $this->input->post('email'),
          'tieude' => $this->input->post('title'),
          'noidung' => $this->input->post('content'),
          ); */
        if ($this->input->post('phanhoi') === "Gui") {
            $this->showUI('user/lienhe/thankforfeedback', $data);
        }
    }

    function showUI($path, $data) {
        $data['title'] = $this->title;
        $this->load->view('user/common/header_view', $data);
        $this->load->view('user/common/left_sidebar_view', $data);
        $this->load->view('user/common/head_content_view', $data);
        $this->load->view($path, $data);
        $this->load->view('user/common/right_sidebar_view', $data);
        $this->load->view('user/common/footer_view', $data);
    }

}
